package com.micrograils.gormwithspringboot

import com.micrograils.gormwithspringboot.service.PersonService
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.ApplicationArguments
import org.springframework.boot.ApplicationRunner
import org.springframework.boot.SpringApplication
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration

@SpringBootApplication(exclude = HibernateJpaAutoConfiguration.class)
class GormWithSpringbootApplication implements ApplicationRunner {

    @Autowired
    PersonService personService

    static void main(String[] args) {
        SpringApplication.run(GormWithSpringbootApplication, args)
    }

    @Override
    void run(ApplicationArguments args) throws Exception {
        personService.sayHelloTo('MicroGrails')
    }
}
